import java.awt.Button;
import java.awt.Frame;
import java.awt.GridLayout;

public class GridLayoutTest {

	public static void main(String[] args) {
		Frame frm = new Frame("Frame with Controls");

		frm.setLayout(new GridLayout(3, 4));

		Button[] btn = new Button[12];
		for (int i=0; i<12; i++)	{
			btn[i] = new Button("Button " + (i+1));
			frm.add(btn[i]);
		}
		
		frm.setBounds(100, 100, 300, 300);
		frm.setVisible(true);
	}
}
